package com.tianyi.wz.walkinggame.activity;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;

import android.util.Log;
import android.widget.Button;
import android.widget.EditText;


import com.tianyi.wz.walkinggame.R;

import org.apache.commons.lang3.StringUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class InitActivity extends BaseActivity {

    @BindView(R.id.et_url)
    EditText etUrl;
    @BindView(R.id.btn_submit)
    Button btnSubmit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_init);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.btn_submit)
    public void submit(){
        Intent i = new Intent(InitActivity.this,MainActivity.class);
        String url = etUrl.getText().toString();
        i.putExtra("url", StringUtils.isEmpty(url)?etUrl.getHint():url);
        Log.d(InitActivity.class.getName(),url);
        startActivity(i);
        finish();
    }

}
